<ui:composition
        xmlns="http://www.w3.org/1999/xhtml"
        xmlns:f="http://java.sun.com/jsf/core"
        xmlns:h="http://java.sun.com/jsf/html"
        xmlns:ui="http://java.sun.com/jsf/facelets"
        xmlns:p="http://primefaces.org/ui"
        xmlns:jsf="http://xmlns.jcp.org/jsf"
        xmlns:c="http://xmlns.jcp.org/jsp/jstl/core"
        xmlns:ezcomp="http://xmlns.jcp.org/jsf/composite/ezcomp">
    <script>
        $(function () {
            var Height = (document.documentElement.clientHeight || document.body.clientHeight) + 175;
            document.getElementById("maintab:cgcarlist:cgcarlists").style.height = Height - 400 + "px";
        });
        window.onresize = function () {
            var Height = (document.documentElement.clientHeight || document.body.clientHeight) + 175;
            document.getElementById("maintab:cgcarlist:cgcarlists").style.height = Height - 1000 + "px";
        };
    </script>
    <script language="JavaScript" type="text/javascript">
        function clearNoNum(obj) {
            obj.value = obj.value.replace(/[^\d.]/g, ""); //清除“数字”和“.”以外的字符
            obj.value = obj.value.replace(/\.{2,}/g, "."); //只保留第一个. 清除多余的
            obj.value = obj.value.replace(".", "$#$").replace(/\./g, "").replace("$#$", ".");
            obj.value = obj.value.replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3'); //只能输入两个小数
        }
    </script>
    <h:form id="cgcarlist">
        <!--按钮-->
        <p:panel id="cgrkcarlist" style="height: 40px;font-weight: bolder;font-size: 20px;text-align: center ">
            <span>采购入库找车</span>
        </p:panel>
        <p:menubar id="menu">
            <f:facet name="options">
                <p:commandButton value="查询" icon="fa fa-search" action="#{kzbd.bb('zhaocar').mc.dialog1}"
                                 process="@this" update="msg,maintab:cgcarlist:Car_02"/>
                <p:commandButton value="新增" icon="fa fa-plus-square" action="#{kzbd.bb('zhaocar').mc.dialog}"
                                 process="@this" update="msg,maintab:cgcarlist:Car_01"/>
                <p:commandButton value="删除" icon="fa fa-trash" action="#{kzbd.bb('zhaocar').mc.delete}"
                                 process="@this,maintab:cgcarlist:tblist" update="msg,maintab:cgcarlist:tblist" onclick="return confirm('是否选择删除，您确定要删除吗？')"/>
                <p:commandButton value="确认找车" icon="fa fa-car" action="#{kzbd.bb('zhaocar').mc.zhaocar}"
                                 process="@this,maintab:cgcarlist:tblist" update="msg,maintab:cgcarlist:tblist"/>
                <p:commandButton value="取消找车" icon="fa fa-trash" action="#{kzbd.bb('zhaocar').mc.quxiaocar}"
                                 process="@this,maintab:cgcarlist:tblist" update="msg,maintab:cgcarlist:tblist" onclick="return confirm('是否选择取消，您确定要取消吗？')"/>
            </f:facet>
        </p:menubar>
        <div id="cgcarlists" style="height: 640px;position: relative;overflow: hidden">
            <p:dataTable emptyMessage="无记录" id="tblist" var="li" rowIndexVar="lia" showGridlines="true"
                         stripedRows="true" resizableColumns="true"  selectionMode="single" selection="#{kzbd.bb('zhaocar').mc.lbselectrow}"
                         value="#{kzbd.bb('zhaocar').mc.carlist}" reflow="true" styleClass="products-table"
                         scrollable="true" scrollHeight="95%"
                         rowKey="#{li.nid}" paginator="true" rows="100" style="visibility: visible !important"
                         paginatorPosition="bottom" rowsPerPageTemplate="10,20,50,100">
                <p:column headerText="日期" style="width: 70px;text-align:center">
                    <h:outputText value="#{li.Date}" style="display: block;text-align: center"/>
                </p:column>
                <p:column headerText="公司" style="width: 70px;text-align:center">
                    <h:outputText value="#{li.Company}" style="display: block;text-align: center"/>
                </p:column>
                <p:column headerText="类型" style="width: 70px;text-align:center">
                    <h:outputText value="#{li.Typesof}" style="display: block;text-align: center"/>
                </p:column>
                <p:column headerText="吨数" style="width: 70px;text-align:center">
                    <h:outputText value="#{li.ds}" style="display: block;text-align: center"/>
                </p:column>
                <p:column headerText="始发地" style="width: 100px;text-align:center">
                    <h:outputText value="#{li.Ogigin}" style="display: block;text-align: left" title="#{li.Ogigin}"/>
                </p:column>
                <p:column headerText="目的地" style="width: 100px;text-align:center" >
                    <h:outputText value="#{li.Address}" style="display: block;text-align: left" title="#{li.Address}"/>
                </p:column>
                <p:column headerText="详细地址" style="width: 100px;text-align:center">
                    <h:outputText value="#{li.Destination}" style="display: block;text-align: left" title="#{li.Destination}"/>
                </p:column>
                <p:column headerText="备注" style="width: 100px;text-align:center">
                    <h:outputText value="#{li.Notes}" style="display: block;text-align: left"/>
                </p:column>
                <p:column headerText="制单人" style="width: 100px;text-align:center">
                    <h:outputText value="#{li.Createname}" style="display: block;text-align: left"/>
                </p:column>
                <p:column headerText="制单时间" style="width: 100px;text-align:center">
                    <h:outputText value="#{li.Createdate}" style="display: block;text-align: left"/>
                </p:column>
                <p:column headerText="状态" style="width: 100px;text-align:center">
                    <h:outputText value="#{li.State}" style="display: block;text-align: left"/>
                </p:column>
            </p:dataTable>
        </div>
        <p:dialog id="Car_01" header="新增" visible="#{kzbd.bb('zhaocar').mc.dialog}" height="400" width="800"
                  closable="false">
            <p:menubar id="Car_01_001">
                <f:facet name="options">
                    <p:commandButton icon="ui-icon-find-in-page" action="#{kzbd.bb('zhaocar').mc.insert}"
                                     process="@this,maintab:cgcarlist:Car_01"
                                     update="msg,maintab:cgcarlist:Car_01,maintab:cgcarlist:tblist" value="保存"
                                     disabled="#{kzbd.bb('zhaocar').mc.bckz}"/>
                    <p:commandButton icon="ui-icon-find-in-page" action="#{kzbd.bb('zhaocar').mc.GBdialog}"
                                     process="@this,maintab:cgcarlist:Car_01"
                                     update="msg,maintab:cgcarlist:Car_01" value="关闭"/>
                </f:facet>
            </p:menubar>
            <p:fragment id="CAR_01">
                <div class="ui-g">
                    <div class="ui-g-2">
                        <p:outputLabel value="日期"/>
                    </div>
                    <div class="ui-g-4">
                        <p:inputText style="width:160px" readonly="true" value="#{kzbd.bb('zhaocar').mc.createdate}"/>
                    </div>
                    <div class="ui-g-2">
                        <p:outputLabel value="公司"/>
                    </div>
                    <div class="ui-g-4">
                        <p:autoComplete value="#{kzbd.bb('zhaocar').mc.zhaochegs}" forceSelection="true"
                                        completeMethod="#{kzbd.bb('zhaocar').mc.czwczth}"
                                        scrollHeight="300"></p:autoComplete>
                    </div>
                </div>
                <div class="ui-g">
                    <div class="ui-g-2">
                        <p:outputLabel value="类型"/>
                    </div>
                    <div class="ui-g-4">
                        <p:inputText style="width:160px" readonly="true" value="#{kzbd.bb('zhaocar').mc.zhaochelx}"/>
                    </div>
                    <!--                    <div class="ui-g-2">-->
                    <!--                        <p:outputLabel value="找车负责人"/>-->
                    <!--                    </div>-->
                    <!--                    <div class="ui-g-4">-->
                    <!--                        <p:autoComplete value="{kzbd.bb('zhaocar').mc.zhaochefzr}" forceSelection="true"-->
                    <!--                                        completeMethod="{kzbd.bb('zhaocar').mc.czwczcfzr}"-->
                    <!--                                        scrollHeight="300"></p:autoComplete>-->
                    <!--                    </div>-->
                </div>
                <div class="ui-g">
                    <div class="ui-g-2">
                        <p:outputLabel value="车数量"/>
                    </div>
                    <div class="ui-g-4">
                        <p:inputNumber style="width:160px"  value="#{kzbd.bb('zhaocar').mc.zhaochesl}" minValue="1" maxValue="10" decimalPlaces="0" />
                    </div>
                    <div class="ui-g-2">
                        <p:outputLabel value="吨数"/>
                    </div>
                    <div class="ui-g-4">
                        <p:inputNumber style="width:150px"  value="#{kzbd.bb('zhaocar').mc.zhaocheds}"  maxValue="200" decimalPlaces="0" />
                    </div>
                </div>
                <div class="ui-g">
                    <div class="ui-g-2">
                        <p:outputLabel value="始发地"/>
                    </div>
                    <div class="ui-g-4">
                        <p:inputText style="width:460px" value="#{kzbd.bb('zhaocar').mc.zhaochesfd}"/>
                    </div>
                </div>
                <div class="ui-g">
                    <div class="ui-g-2">
                        <p:outputLabel value="详细地址"/>
                    </div>
                    <div class="ui-g-4">
                        <p:inputText style="width:460px" value="#{kzbd.bb('zhaocar').mc.zhaochexxdz}"/>
                    </div>
                </div>
                <div class="ui-g">
                    <div class="ui-g-2">
                        <p:outputLabel value="目的地"/>
                    </div>
                    <div class="ui-g-4">
                        <p:inputText style="width:460px" value="#{kzbd.bb('zhaocar').mc.zhaochemdd}"/>
                    </div>
                </div>
                <div class="ui-g">
                    <div class="ui-g-2">
                        <p:outputLabel value="备注"/>
                    </div>
                    <div class="ui-g-4">
                        <p:inputText style="width:460px" value="#{kzbd.bb('zhaocar').mc.zhaochebz}"/>
                    </div>
                </div>
            </p:fragment>
        </p:dialog>
        <p:dialog id="Car_02" header="查询" visible="#{kzbd.bb('zhaocar').mc.dialog1}" height="400" width="800"
                  closable="false">
            <p:menubar id="Car_02_001">
                <f:facet name="options">
                    <p:commandButton icon="ui-icon-find-in-page" action="#{kzbd.bb('zhaocar').mc.select}"
                                     process="@this,maintab:cgcarlist:Car_02"
                                     update="msg,maintab:cgcarlist:Car_02,maintab:cgcarlist:tblist" value="查询"/>
                    <p:commandButton icon="ui-icon-find-in-page" action="#{kzbd.bb('zhaocar').mc.GBdialog1}"
                                     process="@this,maintab:cgcarlist:Car_02"
                                     update="msg,maintab:cgcarlist:Car_02" value="关闭"/>
                </f:facet>
            </p:menubar>
            <p:fragment id="CAR_02">
                <div class="ui-g">
                    <div class="ui-g-2">
                        <p:outputLabel value="制单人"/>
                    </div>
                    <div class="ui-g-4">
                        <p:inputText style="width:160px" readonly="true" value="#{kzbd.bb('zhaocar').mc.cxzczdr}"/>
                    </div>
                    <div class="ui-g-2">
                        <p:outputLabel value="找车负责人"/>
                    </div>
                    <div class="ui-g-4">
                        <p:autoComplete value="#{kzbd.bb('zhaocar').mc.cxzcfzr}" forceSelection="true"
                                        completeMethod="#{kzbd.bb('zhaocar').mc.czwczcfzr}"
                                        scrollHeight="300"></p:autoComplete>
                    </div>
                </div>
                <div class="ui-g">
                    <div class="ui-g-2">
                        <p:outputLabel value="开始日期"/>
                    </div>
                    <div class="ui-g-4">
                        <p:datePicker pattern="yyyy-MM-dd" id="kaishi" value='#{kzbd.bb("zhaocar").mc.cxzcksdate}' inputStyle="width:160px"  monthNavigator="true" autocomplete="off"   yearNavigator="true"/>
                    </div>
                    <div class="ui-g-2">
                        <p:outputLabel value="至"/>
                    </div>
                    <div class="ui-g-4">
                        <p:datePicker pattern="yyyy-MM-dd" id="jieshu" value='#{kzbd.bb("zhaocar").mc.cxzxjsdate}' inputStyle="width:160px"  monthNavigator="true" autocomplete="off"   yearNavigator="true"/>
                    </div>
                </div>
            </p:fragment>
        </p:dialog>
    </h:form>
</ui:composition>
